﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.infodms.dms.common.Constant" %>
<%@ page import="com.infodms.dms.common.FileConstant"%>
<%
	String contextPath = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="<%=contextPath %>/style/content.css" rel="stylesheet" type="text/css" />
	<link href="<%=contextPath %>/style/calendar.css" rel="stylesheet" type="text/css" />
	<link href="<%=contextPath %>/style/page-info.css" rel="stylesheet" type="text/css" />
<jsp:include page="${contextPath}/common/jsp_head_new.jsp" />
<title>角色维护</title>
<style>
.img {
	border: none
}
</style>
</head>

<body onload="pageload()">
<div class="wbox">
<div class="navigation"><img src="<%=contextPath%>/img/nav.gif" />&nbsp;当前位置： 系统管理 &gt; 用户管理 &gt; 角色维护</div>
<form id="fm" name="fm"><input type="hidden" name="curPage" id="curPage"
	value="1" />
<input type="hidden" id="orderCol" name="orderCol" value="" />
<input type="hidden" id="order" name="order" value="" />
<table class="table_query" border="0">
	<tr>
		<td class="table_query_3Col_label_4Letter" nowrap="nowrap">角色代码：</td>
		<td class="table_query_4Col_input" nowrap="nowrap"><input
			name="ROLE_NAME" maxlength="30" value="" datatype="1,is_noquotation,30" id="ROLE_NAME" type="text" class="middle_txt" /></td>
		<td class="table_query_3Col_label_4Letter" nowrap="nowrap">角色名称：</td>
		<td class="table_query_4Col_input" nowrap="nowrap"><input
			name="ROLE_DESC" maxlength="30" value="" datatype="1,is_noquotation,30" id="ROLE_DESC" type="text" class="middle_txt" /><span id="rolenameerr"></span></td>
		<td class="table_query_3Col_label_4Letter" nowrap="nowrap">角色类别：</td>
		<td class="table_query_4Col_input" nowrap="nowrap">
			<script type="text/javascript"> genSelBox("ROLE_TYPE",<%=Constant.SYS_USER%>,"",false,"","onchange='onChange2()'");</script></td>
	</tr>
	<tr>
		<td colspan="6" class="table_query_4Col_input"
			style="text-align: center"><input name="queryBtn" type="button"
			class="normal_btn" onclick="__extQuery__(1)" value="查 询" id="queryBtn" /> &nbsp; 
			<input type="button"
			class="normal_btn" onclick="requery()" value="重 置"/> &nbsp; 
			<input
			name="button2" type="button" class="normal_btn"
			onclick="window.location.href='<%=contextPath%>/sysmng/sysrole/ActionSysRole/addSysRoleInit.do'" value="新 增" /></td>
	</tr>
</table>
	<jsp:include page="${contextPath}/queryPage/orderHidden.html" />
</form>
	<jsp:include page="${contextPath}/queryPage/pageDiv.html" /></div>
</body>
</html>
<script>
	function pageload() {
		__extQuery__(1);
	}
    var  GOLB_SPLIT_HIDE_HREF = false;
	var myPage;


	var url = "<%=contextPath%>/sysmng/sysrole/ActionSysRole/sysRoleQuery.json?COMMAND=1";
	  
	//设置表格标题
	var title = null;
	
	//设置列名属性
	var columns = [
					{header: "序号", align:'center', renderer:getIndex,width:'7%'},
					{header: "角色代码", dataIndex: 'roleName', align:'center', orderCol:"ROLE_NAME"},
					{header: "角色名称", dataIndex: 'roleDesc', align:'center'},
					{header: "角色类别", dataIndex: 'roleType', align:'center',renderer:getItemValue},
					{header: "状态", dataIndex: 'roleStatus', align:'center',renderer:getItemValue, orderCol:"ROLE_STATUS"},
					{id:'action',header: "操作", width:55,sortable: false,dataIndex: 'roleId',renderer:myLink}
			      ];

	//设置超链接
   function myLink(value,metadata){
       return String.format(
              "<a href=\"<%=contextPath%>/sysmng/sysrole/ActionSysRole/viewSysRoleInit.do?roleId="
					+ value + "\">[查看]</a>");
	}

	function requery() {
		$('ROLE_DESC').value="";
		$('ROLE_NAME').value="";
	}
   function onChange2(){
     var tab = $('myTable');
     if(tab!=undefined&& tab){
        var len = tab.rows.length;
        if(len && len>1){
        	for(var i=1;tab.rows.length>=1;){
          	  tab.deleteRow(i);
          	}
        }
     }
   }
</script>